<template>
	<view class="content">
		<view class="view-center">
			<view class="title">手机号码登录</view>
			<input class="uni-input" type="number" placeholder="请输入手机号码" @input="onKeyPhoneInput" />
			<input class="uni-input" type="number" placeholder="输入验证码" @input="onKeyPhoneCodeInput" />

			<button class="mini-btn" type="primary" size="mini" @click="bindPhone()">登录</button>
		</view>
	</view>
</template>

<script>
import { mapMutations } from 'vuex';
export default {
	data() {
		return {
			phoneCode: 0,
			phoneNum: 0
		};
	},

	methods: {
		...mapMutations({
			updateUserMsg: 'userSotre/updateUserMsg'
		}),

		onKeyPhoneInput: function(event) {
			this.phoneNum = Number(event.target.value || 0);
		},

		onKeyPhoneCodeInput: function(event) {
			this.phoneCode = Number(event.target.value || 0);
		},

		bindPhone: function() {
			this.updateUserMsg({
				name: '',
				sex: 1,
				currnetOm: 1000,
				uPhone: 1234566789,
				baseTurn: 100,
			});
			this.commonOm.switchTab({
				url: '../main/main'
			});
		}
	}
};
</script>

<style>
.view-center {
	margin: 0 auto;
}
</style>
